package logic

type Score int

const (
	LowScore  Score = 1
	MidScore  Score = 2
	HighScore Score = 3
)

type PvpPools struct {
	pools map[Score]*PvpPool
}

func NewPvpPools() *PvpPools {
	pps := &PvpPools{
		pools: make(map[Score]*PvpPool),
	}
	pps.init()
	return pps
}

func (pps *PvpPools) init() {
	pps.pools[LowScore] = newPvpPool()
	pps.pools[MidScore] = newPvpPool()
	pps.pools[HighScore] = newPvpPool()
}

func (pps *PvpPools) addToPool(score Score, player *Player) {
	pool, ok := pps.pools[score]
	if !ok {
		return
	}
	player.score = score
	pool.addPlayerChannel(player)
}
